class Menu
{
  private PImage play;
  private PImage playOver;
  private PImage playDown;
  private PImage instructions;
  private PImage instOver;
  private PImage instDown;
  private PImage goBack;
  private PImage goBackOver;
  private PImage goBackDown;
  private PImage backPicture;
  private PImage instructionPicture;
  private Button playButton;
  private Button instButton;
  private Button backButton;
  public boolean finished;
  public boolean atInstructions;
  
  public Menu()
  {
    play = loadImage("play1.jpg");
    playOver = loadImage("play2.jpg");
    playDown = loadImage("play3.jpg");
    instructions = loadImage("controls1.jpg");
    instOver = loadImage("controls2.jpg");
    instDown = loadImage("controls3.jpg");
    goBack = loadImage("back1.jpg");
    goBackOver = loadImage("back2.jpg");
    goBackDown = loadImage("back3.jpg");
    backPicture = loadImage("cover.jpg");
    instructionPicture = loadImage("controls.jpg");
    
    playButton = new Button(90, 230, play.width, play.height, play, playOver, playDown, this);
    instButton = new Button(452, 231, instructions.width, instructions.height, instructions, instOver, instDown, this);
    backButton = new Button(471, 346, goBack.width, goBack.height, goBack, goBackOver, goBackDown, this);
    
    finished = false;
    atInstructions = false;
  }
  
  public void draw()
  {
    if (!atInstructions)
    {
      image(backPicture, 0, 0, backPicture.width, backPicture.height);
      playButton.draw();
      instButton.draw();
      
      if (playButton.isPressed())
      {
        finished = true;
      }
      else if (instButton.isPressed())
      {
        atInstructions = true;
      }
    }
    else
    {
      image(instructionPicture, 0, 0, instructionPicture.width, instructionPicture.height);
      backButton.draw();
      
      if (backButton.isPressed())
        atInstructions = false;
    }
  }
  
  public boolean isDone()
  {
    return finished;
  }
  
  public void reset()
  {
     finished = false;
  }
  
}
